package cn.yjh.api.impl;

import cn.yjh.annotation.RPCMapping;
import cn.yjh.annotation.RPCService;
import cn.yjh.api.ConfigurationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.TimeUnit;

/**
 * @DESC:
 * @AUTHOR: YouJinhua
 * @DATE: 2021-11-25 22:28:19
 * @VERSION: 1.0
 */
public class ConfigurationServiceImpl implements ConfigurationService {

    private static final Logger logger = LoggerFactory.getLogger(ConfigurationServiceImpl.class);

    /*@Override
    public boolean updateConfiguration(Configuration config) {
        logger.info("update Configuration");
        MonitorContext.multicaster.multicasterEvent(new UpdateConfigurationEvent(),true);
        return false;
    }*/

    @RPCMapping("/updateConfig")
    @Override
    public boolean updateConfiguration(String config) {
        logger.info("update Configuration");
        try {
            TimeUnit.MILLISECONDS.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return false;
    }
}
